package chapter5;

public class Card {
	public enum Suit {
		SPADES(0), DIAMONDS(1), CLUBS(2), HEARTS(3), JOKER(4);
		private int suitValue;

		Suit(int s) {
			suitValue = s;
		}

		public int getSuitValue() {
			return suitValue;
		}
		public String toString(){
				return name(); 
			}
	}

	public enum Rank {
		ACE(1), KING(13), QUEEN(12), JACK(11), TEN(10), NINE(9), EIGHT(8), SEVEN(
				7), SIX(6), FIVE(5), FOUR(4), THREE(3), TWO(2);
		private int rankValue;

		Rank(int r) {
			rankValue = r;
		}

		public int getRankValue() {
			return rankValue;
		}
//		public String toString(){
//			return name();
////			switch (this){
////			case ACE:
////				return "Ace";
////			case KING:
////				return "King";
////			case QUEEN:
////				return "Queen";
////			case JACK:
////				return "Jack";
////			case TWO:
////				return "Two";
////			case THREE:
////				return "Three";
////			case FOUR:
////				return "Four";
////			case FIVE:
////				return "Five";
////			case SIX:
////				return "Six";
////			case SEVEN:
////				return "Seven";
////			case EIGHT:
////				return "Eight";
////			case NINE:
////				return "Nine";
////			case TEN:
////				return "Ten";
////				default:
////					return "123";
////			}
//			
//			
//		}
//	
}
	
	private final Rank rank;
	private final Suit suit;
	
	public Card(Rank rank, Suit suit) {
		 if (rank == null || suit == null)
             throw new NullPointerException("Card suit and value cannot be null.");
		     
		      this.rank = rank;
		      this.suit = suit;
		   }
	public String toString(){
		return rank.name()+" "+suit.name();
	}
	
	
	   public static void main(String[] args) {
//		   for (Suit s: Suit.values()){
//			   for (Rank r: Rank.values()){
//				   Card c = new Card (r,s);
//				   System.out.println ("next card is " +c);
//			   }
		   for ( int i = 52; i > 0; i-- ) {
		         int rand = (int)(Math.random()*(i+1));
		         System.out.println ("next random number is " +rand);
		   }
	   }
}
